Nexcess Logo

How to export tables and import MySQL tables via CLI/SSH

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
September 11, 2019

This method requires SSH access. Nexcess clients on physical (non-cloud) servers must first enable SSH access and adjust their firewall settings in SiteWorx; Cloud accounts have SSH enabled by default.

  1. SSH into the server and enter the following command, but remove the brackets and replace the placeholder text within those brackets:
    mysqldump -u [username] -p [database_name] > [dumpfilename.sql]
  2. Enter your password when prompted.

  3. To accelerate the upcoming transfer to the new server, execute the following command, but remove the brackets and replace the placeholder text within those brackets:
    tar zcf [dumpfilename].tar.gz [dumpfilename].sql
  4. Transfer the compressed file to the new server using FTP.

  5. On the new server, decompress the file:
    tar zxf [dumpfilename].tar.gz
  6. Launch the import process:
    mysql -u [username] -p [database_name] < [dumpfilename.sql]
  7. Enter your password when prompted to begin the import.

  8. When you see the ready cursor, the import has finished.

Other resources

For the complete MySQL documentation, refer to the MySQL development website.


For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

Jason Dobry
When you visit our site, we may collect personal information about you, including through cookies and similar technology. To read more, please refer to our Privacy Policy. By clicking accept or continuing to browse, you consent to our practices.